package crm.view.popup;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.border.BevelBorder;

import crm.model.teacherPC.net.PcWindow;
import crm.model.teacherPC.net.StudentPC;



public class WindowPopup extends JPopupMenu implements ActionListener {
	private static WindowPopup popup;

	private PcWindow window = null;
	static {
		popup = new WindowPopup();
	}
	public static void show(PcWindow window, Component c, int x, int y){
		popup.showPopUp(window, c, x, y);
	}
	public void showPopUp(PcWindow window,  Component c, int x, int y){
		this.window = window;
		 show(c,x,y);
	}
	public WindowPopup() {
		setBorder(new BevelBorder(BevelBorder.RAISED));
		JMenuItem item = new JMenuItem("Maximaze");
		item.addActionListener(this);
		add(item);
		item = new JMenuItem("Minimaze");
		item.addActionListener(this);
		add(item);
		item = new JMenuItem("Kill");
		item.addActionListener(this);
		add(item);
	}

	public void actionPerformed(ActionEvent ev) {
		if (ev.getActionCommand().equals("Maximaze")) {
			window.maximize();
		} else if (ev.getActionCommand().equals("Minimaze")) {
			window.minimize();
		}else if (ev.getActionCommand().equals("Kill")) {
			window.kill();
		} {

		}

	}
}
